import { BaseController } from '@/api/BaseController';
import { RequestOption } from '@/common/http/types';
import { ANY_OBJECT } from '@/types/generic';
import { TableData } from '@/common/types/table';
import { useUrlBuilder } from '@/common/hooks/useUrl';
import StudentClass from '@/types/table/studentClass';
import { CourseData } from '@/api/generated/courseController';
import { StudentData } from '@/api/generated/studentController';
import { SysDeptData } from '@/api/generated/sysDeptController';
import { API_CONTEXT } from '../config';

const { buildGetUrl } = useUrlBuilder();

export interface StudentClassData extends StudentClass {
  courseList?: CourseData[];
  studentList?: StudentData[];
  sysDept?: SysDeptData;
  __cascade_add_temp_id__?: string | number | undefined;
}

export default class StudentClassController extends BaseController {
  static list(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post<TableData<StudentClassData>>(API_CONTEXT + '/app/studentClass/list', params, httpOptions);
  }
  static view(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.get<StudentClassData>(API_CONTEXT + '/app/studentClass/view', params, httpOptions);
  }
  static export(params: ANY_OBJECT, fileName: string) {
    return super.download(API_CONTEXT + '/app/studentClass/export', params, fileName);
  }
  static import(params: ANY_OBJECT) {
    return super.upload(API_CONTEXT + '/app/studentClass/import', params);
  }
  static printUrl(params: ANY_OBJECT) {
    return buildGetUrl(API_CONTEXT + '/app/studentClass/print', params);
  }
  static add(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/add', params, httpOptions);
  }
  static update(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/update', params, httpOptions);
  }
  static delete(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/delete', params, httpOptions);
  }
  static deleteBatch(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/deleteBatch', params, httpOptions);
  }
  static startOnlyFlowAddClass(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/startOnly/flowAddClass', params, httpOptions);
  }
  static startWithBusinessKeyFlowAddClass(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/startWithBusinessKey/flowAddClass', params, httpOptions);
  }
  static startAndTakeUserTaskFlowAddClass(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/startAndTakeUserTask/flowAddClass', params, httpOptions);
  }
  static startAndSaveDraftFlowAddClass(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/startAndSaveDraft/flowAddClass', params, httpOptions);
  }
  static submitUserTaskFlowAddClass(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/submitUserTask/flowAddClass', params, httpOptions);
  }
  static viewTaskBusinessDataFlowAddClass(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.get(API_CONTEXT + '/app/studentClass/viewTaskBusinessData/flowAddClass', params, httpOptions);
  }
  static viewHistoricTaskBusinessDataFlowAddClass(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.get(API_CONTEXT + '/app/studentClass/viewHistoricTaskBusinessData/flowAddClass', params, httpOptions);
  }
  static listWorkOrderFlowAddClass(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/listWorkOrder/flowAddClass', params, httpOptions);
  }
  static viewNotInClassCourseListFlowAddClass(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/viewNotInClassCourseList/flowAddClass', params, httpOptions);
  }
  static viewNotInClassStudentListFlowAddClass(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/viewNotInClassStudentList/flowAddClass', params, httpOptions);
  }
  static listClassCourse(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/listClassCourse', params, httpOptions);
  }
  static listNotInClassCourse(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/listNotInClassCourse', params, httpOptions);
  }
  static addClassCourse(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/addClassCourse', params, httpOptions);
  }
  static deleteClassCourse(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/deleteClassCourse', params, httpOptions);
  }
  static deleteClassCourseList(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/deleteClassCourseList', params, httpOptions);
  }
  static updateClassCourse(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/updateClassCourse', params, httpOptions);
  }
  static viewClassCourse(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.get(API_CONTEXT + '/app/studentClass/viewClassCourse', params, httpOptions);
  }
  static listClassStudent(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/listClassStudent', params, httpOptions);
  }
  static listNotInClassStudent(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/listNotInClassStudent', params, httpOptions);
  }
  static addClassStudent(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/addClassStudent', params, httpOptions);
  }
  static deleteClassStudent(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/deleteClassStudent', params, httpOptions);
  }
  static deleteClassStudentList(params: ANY_OBJECT, httpOptions?: RequestOption) {
    return super.post(API_CONTEXT + '/app/studentClass/deleteClassStudentList', params, httpOptions);
  }
}
